<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .div {
      font-size: 20px;
    }

    .p {
      font-size: 2em;
    }

    .span {
      font-size: 0.5em;
    }
  </style>

</head>

<body>
  <div class="div">div 标签中的文字大小为 20px
    <p class="p">P 标签中的文字大小为 2em = 40px
      <span class="span">span标签中的文字大小为0.5em = 20px</span>
    </p>
  </div>

</body>

</html>